unit DelavecFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SifrantFrm, DBBaseFrm, cxStyles, cxCustomData, cxGraphics, cxFilter,
  cxData, cxEdit, DB, cxDBData, cxGridBandedTableView, DBClient, MConnect,
  alBaseDataSet, cxEditRepositoryItems, cxContainer, StdActns, ActnList,
  cxGridLevel, cxGridCustomTableView, cxGridTableView,
  cxGridDBBandedTableView, cxClasses, cxControls, cxGridCustomView, cxGrid,
  cxTextEdit, cxMaskEdit, cxDBEdit, StdCtrls, ExtCtrls, cxDropDownEdit,
  cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, cxDBEditRepository,
  ImgList, PoslovanjeSrv_TLB, cxDataStorage, kdbinfo, kdbstruc;

type
  TfrmDelavec = class(TfrmSifrant)
    lblUlica: TLabel;
    edtUlica: TcxDBTextEdit;
    lblPosta: TLabel;
    lkpcbPostaSifra: TcxDBLookupComboBox;
    lkpcbPosta: TcxDBLookupComboBox;
    lblMaticnaStevilka: TLabel;
    edtMaticnaStevilka: TcxDBMaskEdit;
    scnPosta: TSharedConnection;
    cdsPosta: TBaseDataSet;
    dtsrcPosta: TDataSource;
    rpstMainUlica: TcxEditRepositoryTextItem;
    rpstMainPostaSifra: TcxEditRepositoryLookupComboBoxItem;
    rpstMainPostaNaziv: TcxEditRepositoryLookupComboBoxItem;
    rpstMainEMSO: TcxEditRepositoryMaskItem;
    grdtvMainEMSO: TcxGridDBBandedColumn;
    grdtvMainDavcnaStevilka: TcxGridDBBandedColumn;
    rpstMainDavcnaStevilka: TcxEditRepositoryMaskItem;
    edtDavcnaStevilka: TcxDBMaskEdit;
    lblDavcnaStevilka: TLabel;
  private
    { Private declarations }
  protected
    function GetSessionParamRelations(DataSet: TDataSet): TSessionParamRelations; override;
    procedure Deinitialize; override;
    procedure DoDBRefresh; override;
    procedure Initialize; override;
  public
    { Public declarations }
  end;

var
  frmDelavec: TfrmDelavec;

implementation

uses
  MainFrm;

{$R *.dfm}

{ TfrmDelavec }

procedure TfrmDelavec.Deinitialize;
begin
  cdsPosta.Close;
  inherited;
end;

procedure TfrmDelavec.DoDBRefresh;
begin
  inherited;
  cdsPosta.Refresh;
end;

function TfrmDelavec.GetSessionParamRelations(
  DataSet: TDataSet): TSessionParamRelations;
begin
  if DataSet = cdsMain then
  begin
    SetLength(Result, 1);
    Result[0].FieldName := 'REF_ID';
    Result[0].SessionName := 'PODJETJE_ID';
  end;
end;

procedure TfrmDelavec.Initialize;
begin
  inherited;
  cdsPosta.Open;
end;

end.
